package com.duolun.channel.demo;

import com.duolun.channel.client.ChannelClient;
import com.duolun.channel.client.ChannelNode;
import com.duolun.channel.common.model.Status;

/**
 * @author zhuwj.cn
 */
public class MyChannelNodeHandler extends ChannelNode.AbstractNodeEventHandler {
    @Override
    public void onLoginSuccess(ChannelClient channelClient) {
        System.out.println("======================= onLoginSuccess ==================");
        System.out.println("account = " + channelClient.getAccount());
    }

    @Override
    public void onLoginFail(ChannelClient channelClient, String errorMsg) {
        System.out.println("======================= onLoginFail ==================");
        System.out.println("account = " + channelClient.getAccount());
        System.out.println("errorMsg = " + errorMsg);
    }

    @Override
    public void onMessage(String account, String messageId, String content) {
        System.out.println("======================= onMessage ==================");
        System.out.println("account = " + account);
        System.out.println("messageId = " + messageId);
        System.out.println("content = " + content);
    }

    @Override
    public void onClientState(String account, Status status) {
        System.out.println("======================= onClientState ==================");
        System.out.println("account = " + account);
        System.out.println("status = " + status);
    }

    @Override
    public void onPushSuccess(String account, String messageId) {
        System.out.println("======================= onPushSuccess ==================");
        System.out.println("account = " + account);
        System.out.println("messageId = " + messageId);
    }

    @Override
    public void onPushFail(String account, String messageId) {
        System.out.println("======================= onPushFail ==================");
        System.out.println("account = " + account);
        System.out.println("messageId = " + messageId);
    }
}
